In controlling a servo motor for driving a feed shaft of a machine tool, an arm of a robot, etc., there are a case where the servo motor is controlled in a position/velocity control mode for controlling a position and a velocity, and a case where the servo motor is controlled in a torque control mode for controlling a force. The torque control mode is for making a servo motor output a torque commanded by a controller to provide an object driven by the servo motor with a force according to the command. The torque control mode is adopted in carrying out an operation for giving a constant tension to an object, an operation for pressing an object and an operation for fitting an object having indefinite profile, for example.
The position/velocity control mode and the torque control mode are often used in combination. For example, these modes are combined in a manner such that an object driven by the servo motor is moved to a specified position in the position control mode, the torque is controlled at the specified position in the torque control mode, and the object is moved again in the position control mode.
In the case where the servo motor is controlled by the combination of the position/velocity control mode and the torque control mode, the control mode is changed over between the above two control modes. When the control mode is changed in moving the movable part of the machine driven by the servo motor, a shock occurs inevitably. Thus, the changing over of the control mode is usually carried out when the movable part is stopped. In the above conventional change-over method, however, when a control mode is changed over from the torque control mode to the position/velocity control mode, an object of control may receive a shock due to discontinuity of a torque command value.
FIG. 6 shows a conventional servo control system for controlling a servo motor by changing over the control mode. In FIG. 6, the servo motor is controlled based on either a torque command Tcmd1 or a position command from a CNC. When controlling the servo motor based on the torque command Tcmdl from the CNC, a switch 5 is changed over to a torque command side to set the torque command Tcmd1 as a torque command Tcmd to the servo motor. When controlling the servo motor based on a position command, the position command is processed by a position control loop 6 and a velocity control loop 7 to obtain a torque command Tcmd2, and the switch 5 is changed over to a position command side to set the torque command Tcmd2 as a torque command Tcmd to the servo motor.
In the above conventional servo motor control, when the control mode is changed over from the torque control mode to the position/velocity control mode, a value of the torque command Tcmd for the servo motor differs before and after the changing over, to cause the discontinuity of the value of the torque command Tcmd so that a shock may be applied to the object of control.
Conventionally, the shock in the changing over may be allowed or there has been taken a measure for reducing the shock by carrying out servo control in the position/velocity control mode after setting a torque command in the torque control mode to "0" in changing over the control mode. This method, however, could not sufficiently eliminate the shock in changing over the control mode.